using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using RA_WebSite.Models;
using RA_WebSite.Models.Mapping;

namespace RA_WebSite.Models
{
    /// <summary>
    /// Classe per interagire con database in modo da recuperare e persistere gli oggetti
    /// </summary>
    public partial class RAContext : DbContext
    {
        static RAContext()
        {
            //Database.SetInitializer<RAContext>(null);
        }

        public RAContext()
            : base("Name=RAContext")
        {
        }

        public DbSet<Analisi> Analisis { get; set; }
        public DbSet<Campione> Campiones { get; set; }
        public DbSet<GradoDiRuggine> GradoDiRuggines { get; set; }
        public DbSet<Ordine> Ordines { get; set; }
        public DbSet<Pittura> Pitturas { get; set; }
        public DbSet<Provino> Provinoes { get; set; }
        public DbSet<Step> Steps { get; set; }
        public DbSet<TipoDiRuggine> TipoDiRuggines { get; set; }
        public DbSet<Utente> Utentes { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new AnalisiMap());
            modelBuilder.Configurations.Add(new CampioneMap());
            modelBuilder.Configurations.Add(new GradoDiRuggineMap());
            modelBuilder.Configurations.Add(new OrdineMap());
            modelBuilder.Configurations.Add(new PitturaMap());
            modelBuilder.Configurations.Add(new ProvinoMap());
            modelBuilder.Configurations.Add(new StepMap());
            modelBuilder.Configurations.Add(new TipoDiRuggineMap());
            modelBuilder.Configurations.Add(new UtenteMap()); 
        }
    }
}
